/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package cn.itcast;

import java.util.*;

/**
 * <p>Project: JavaStudy - ColorBall
 * <p>Powered by jiangbo On 2023-01-03
 * 09:56:23
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class ColorBall {
    public static void main(String[] args) {
        Random rand = new Random();
        int i = 0;
        while(i<10) {
//蓝色球(1-16 选出1个)
            int blue = rand.nextInt(1, 17);
//红色球(1-33 选出不重复的6个)
            Set<Integer> red = new HashSet<>();
            while (red.size() < 6) {
                red.add(rand.nextInt(1, 34));
            }
            List<Integer> rr = new ArrayList<Integer>(red);
            Collections.sort(rr);
//System.out.println(rr);
//System.out.println(blue);
            List ok = new ArrayList();
            ok.add(rr);
            ok.add(blue);
            System.out.println(ok);
            ++i;
        }
    }
    }



